home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / _HISTORY.MIN < prev    next >
Text File  |  1991-08-09  |  2KB  |  91 lines

  1.  
  2.  
  3.  
  4. Name:F:edit-command-history
  5. Write command history in buffer.
  6. [*]#(ds,history-ptr,0)
  7. #(Ffind-or-make-buffer,*command-history*)
  8. #(Flocal-bind-key,K.C-c C-c,F:read-command-history)
  9. #(an,(To install changes, type C-c C-c))
  10. #(Fedit-command-history)
  11. [*]
  12.  
  13.  
  14. Name:Fedit-command-history
  15. [*]#(is,#(history.##(history-ptr))(
  16. ))
  17. #(g?,##(history-tos),##(history-ptr),(
  18.     #(Fhistory-next)
  19.     #(SELF)
  20. ))[*]
  21.  
  22.  
  23. Name:F:list-command-history
  24. [*]#(ds,history-ptr,0)
  25. #(ds,temp)
  26. #(Flist-command-history)
  27. #(Fmore)
  28. [*]
  29.  
  30.  
  31. Name:Flist-command-history
  32. [*]#(ds,temp,##(temp)#(history.##(history-ptr))(,))
  33. #(g?,##(history-tos),##(history-ptr),(
  34.     #(Fhistory-next)
  35.     #(SELF)
  36. ))[*]
  37.  
  38.  
  39. Name:F:read-command-history
  40. Read command history from the current buffer.
  41. [*]#(sp,[)
  42. #(ds,history.0,##(rm,$))
  43. #(ds,history-ptr,0)
  44. #(ds,history-tos,0)
  45. #(Fread-command-history)
  46. #(ds,history-tos,##(history-ptr))
  47. [*]
  48.  
  49.  
  50. Name:Fread-command-history
  51. [*]#(Fhistory-save,##(rm,$))
  52. #(sp,$>)
  53. #(==,##(rm,>),,,(
  54.     #(SELF)
  55. ))[*]
  56.  
  57.  
  58.  
  59. Name:Fhistory-next
  60. Go up the history stack.
  61. [*]#(g?,##(history-tos),##(history-ptr),(
  62.     #(ds,history-ptr,#(++,##(history-ptr),1))
  63. ),(
  64.     #(ds,history-ptr,##(history-tos))
  65.     #(bl)
  66. ))[*]
  67.  
  68.  
  69. Name:Fhistory-previous
  70. Go down the history stack.
  71. [*]#(g?,##(history-ptr),0,(
  72.     #(ds,history-ptr,#(--,##(history-ptr),1))
  73. ),(
  74.     #(ds,history-ptr,0)
  75.     #(bl)
  76. ))[*]
  77.  
  78.  
  79. Name:Fhistory-save
  80. Store argument on top of the history stack, but only if it's longer than two
  81. characters and distinct from TOS. Go to TOS in any case.
  82. [*]#(ds,history-ptr,#(++,##(history-tos),0))
  83. #(g?,##(nc,(arg1)),2,(
  84.     #(==,##(history.##(history-ptr)),arg1,,(
  85.         #(ds,history.##(history-ptr),arg1)
  86.         #(ds,history-tos,#(++,##(history-tos),1))
  87.     ))
  88. ))[*]
  89.  
  90.  
  91.